home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / misc / wexmast / wlabel.pro < prev    next >
Text File  |  1997-07-08  |  2KB  |  58 lines

  1. ; $Id: wlabel.pro,v 1.3 1997/01/15 04:29:15 ali Exp $
  2. ;
  3. ; Copyright (c) 1993-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. ; This is the code for an example label widget.
  7. ; This example shows two labels, one with a frame around
  8. ; it, and one without.  Since label widgets don't really
  9. ; do anything except serve as titles, prompts, and other
  10. ; kinds of labels, this widget doesn't do very much.
  11.  
  12.  
  13.  
  14. PRO wlabel_event, event
  15.  
  16. ; This is the event handler for the example label widget.
  17. ; It doesn't actually do anything. More complex widgets would, 
  18. ; of course, need a CASE statement or something of that nature
  19. ; to tell IDL what to do when certain widgets were manipulated.
  20.  
  21. END
  22.  
  23. PRO wlabel, GROUP = GROUP
  24. ; This is the procedure that creates a simple label widget.
  25.  
  26. ; Unlike some other types of widgets, label widgets generally
  27. ; do not have to be declared in a common block or even given 
  28. ; User Values.  Label widgets primarily for generating
  29. ; unchanging text fields.
  30.  
  31. base = WIDGET_BASE(TITLE = 'Example Label Widget', $
  32.            /COLUMN, $    ;Organize subsequent widgets in columns.
  33.            XSIZE = 350)    ;Make it wide enough that the 
  34.                                 ;base's title shows completely.
  35.  
  36.  
  37. ; The next commands create two label widgets. The VALUE of a label
  38. ; is the text that will appear in the label.
  39.  
  40. label1 = WIDGET_LABEL(base, $        ;This widget belongs to 'base'.
  41.               VALUE = 'This is a label widget with a frame.', $
  42.               /FRAME)        ;Put a frame around it.
  43.  
  44. label2 = WIDGET_LABEL(base, $        ;This widget belongs to 'base'.
  45.               VALUE = 'This is another label without a frame.')
  46.  
  47. ; Realize the widgets:
  48. WIDGET_CONTROL, base, /REALIZE
  49.  
  50. ; Hand off to the XMANAGER:
  51. XMANAGER, 'wlabel', base, GROUP_LEADER = GROUP, /NO_BLOCK
  52.  
  53. END
  54.  
  55.  
  56.  
  57.  
  58.